#ifndef _ADC_H
#define _ADC_H

#ifdef __cplusplus
extern "C"
{
#endif

#include "stdint.h"
#ifdef __cplusplus
}
#endif
typedef enum
{
    BIT16
} Length;
class ADC
{
private:
    Length len;
    //uint16_t all_len;

public:
    ADC(uint8_t _ChanelNum, Length _len) : ChanelNum(_ChanelNum), len(_len)
    {
        // all_len = ChanelNum * len;
        rawData = new uint32_t[ChanelNum];
        convertVoltage = new float[ChanelNum];
    };
    ~ADC()
    {
        delete rawData;
        delete convertVoltage;
    };
    uint8_t ChanelNum;
    uint32_t *rawData = nullptr;
    float *convertVoltage = nullptr;
    void Convert();
    float getVoltage(uint8_t _channel);
    virtual void Init() = 0;
};

#endif
